<?php

if($this->ipsclass->market_class->installed)
{
	if(IN_DEV == 1)
	{
		$settings_group = $this->ipsclass->DB->build_and_exec_query(array('select'=>'*','from'=>'conf_settings_titles','where'=>"conf_title_keyword='ibmarket'"));
		$CATS[]  = array( 'Exports' );
		
		$PAGES[] = array(
							1 => array( 'Skin XML'  , 'export=skin'  ),
							2 => array( 'Lang XML' , 'export=lang' ),
							3 => array( 'Setting XML' , '&section=tools&act=op&code=MOD_export_setting&conf_group='.$settings_group['conf_title_id'],1),
							4 => array( 'Task XML' , 'export=task'),
					       );
	}
	
	$CATS[]  = array( 'Main' );
	
	if(REMOVE_OTHER_COMPONENTS_MENU)
	{
		$PAGES[] = array(
							1 => array( 'Home'               , 'code=main'                                            ),
							2 => array( 'Database Handler'   , 'code=database'                                        ),
							3 => array( 'Settings'           , '&section=tools&act=op&code=findsetting&key=ibmarket',1),
							4 => array( 'Manage Cache'       , 'code=cache'                                           ),
							5 => array( 'File Edits'         , 'code=edits'                                           ),
							6 => array( 'Tools'              , 'code=tools'                                           ),
							7 => array( 'Plugin Control'     , 'code=plugin'                                          ),
							8 => array( 'Close ibMarket ACP' , '&section=components'								,1),
					       );
	}
	else
	{
		$PAGES[] = array(
							1 => array( 'Home'              , 'code=main'                                            ),
							2 => array( 'Database Handler'  , 'code=database'                                        ),
							3 => array( 'Settings'          , '&section=tools&act=op&code=findsetting&key=ibmarket',1),
							4 => array( 'Manage Cache'      , 'code=cache'                                           ),
							5 => array( 'File Edits'        , 'code=edits'                                           ),
							6 => array( 'Tools'             , 'code=tools'                                           ),
							7 => array( 'Plugin Control'    , 'code=plugin'                                          ),
					       );
	}
	
	if($this->ipsclass->input['code'] == 'plugin' && $this->ipsclass->input['do'] == 'run')
	{
		$plugin = $this->ipsclass->market_class->load_plugin($this->ipsclass->cache['market_plugin'][$this->ipsclass->input['link']]);
		$pages = $this->ipsclass->market_class->plugin_loaded[$this->ipsclass->input['link']]->acp_menu();
		if(is_array($pages) and count($pages))
		{
			$CATS[] = array( $this->ipsclass->cache['market_plugin'][$this->ipsclass->input['link']]['name'] );
			$PAGES[] = $pages;
		}
	}
	
	$CATS[]  = array( 'Categories/Items' );
	
	$PAGES[] = array(
						1 => array( 'Manage'         , 'code=category'        ),
						2 => array( 'Add Categoy'    , 'code=category&do=add' ),
						3 => array( 'Add An Item'    , 'code=item&do=add'     ),
				       );
	
	$CATS[]  = array( 'Board Control' );
	
	$PAGES[] = array(
						1 => array( 'Manage Members' , 'code=members' ),
						2 => array( 'Manage Groups'  , 'code=groups'  ),
						3 => array( 'Manage Forums'  , 'code=forum'   ),
						4 => array( 'Manage Wages'   , 'code=wages'   ),
						5 => array( 'Manage Taxes'   , 'code=taxes'   ),
				       );
	
	$CATS[]  = array( 'Logs' );
	
	$PAGES[] = array(
						1 => array( 'Receipts'        , 'code=logs&do=receipt' ),
						2 => array( 'Item Logs'       , 'code=logs&do=item'    ),
						3 => array( 'Reward Logs'     , 'code=logs&do=reward'  ),
						4 => array( 'Fee Logs'        , 'code=logs&do=fee'     ),
						5 => array( 'Collected Wages' , 'code=wages&do=log'    ),
						5 => array( 'Collected Taxes' , 'code=taxes&do=log'    ),
				       );
}
else
{
	$CATS[]  = array( 'Main' );
	
	$PAGES[] = array(
						1 => array( 'Install/Uninstall ibMarket' , 'code=database' ),
				       );

}

if(!method_exists($this,'meh_to_meh'))
{
	$CATS = $PAGES = array();
}
?>